From: Juanma Barranquero Date: Fri, 16 Apr 2004 19:32:23 +0000 (+0000) Subject: (try_scrolling): Make sure `scroll-conservatively' is not too large before X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~23159 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=cb32f0a63a4ed0460af7d000829fd33ab38e96a8;p=emacs.git (try_scrolling): Make sure `scroll-conservatively' is not too large before computing how much to scroll. --- diff --git a/src/xdisp.c b/src/xdisp.c index b1633132214..2cd1d548457 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10879,6 +10879,12 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, else this_scroll_margin = 0; + /* Force scroll_conservatively to have a reasonable value so it doesn't + cause an overflow while computing how much to scroll. */ + if (scroll_conservatively) + scroll_conservatively = min (scroll_conservatively, + MOST_POSITIVE_FIXNUM / FRAME_LINE_HEIGHT (f)); + /* Compute how much we should try to scroll maximally to bring point into view. */ if (scroll_step || scroll_conservatively || temp_scroll_step)